import request from '@/utils/request'

let interAfterSaleApi = {
  // 中介售后列表
  getList(params) {
    return request({
      url: '/interOrderAfter/list',
      method: 'get',
      params
    })
  },
  
  // 同意售后
  agreeAfterSale(data) {
    return request({
      url: '/interOrderAfter/agree',
      method: 'post',
      data
    })
  },
  
  // 拒绝售后
  rejectAfterSale(data) {
    return request({
      url: '/interOrderAfter/reject',
      method: 'post',
      data
    })
  },
  
  // 查看售后详情
  getAfterSaleDetail(id) {
    return request({
      url: `/interOrderAfter/${id}`,
      method: 'get'
    })
  },
  
  // 检查中介单是否可以申请售后
  checkCanApplyAfterSale(interOrderId) {
    return request({
      url: `/interOrderAfter/checkCanApply/${interOrderId}`,
      method: 'get'
    })
  },
  
  // 申请售后
  applyAfterSale(data) {
    return request({
      url: '/interOrderAfter/apply',
      method: 'post',
      data
    })
  }
}

export default interAfterSaleApi
